package com.hanggold.springboot.lesson3.controller;

import com.hanggold.springboot.lesson3.req.RegxReq;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.ref.SoftReference;

/**
 * @author smc
 * @date 2019-06-27 13:13
 * @since
 **/
//@RestController
@RequestMapping("regx")
public class RegxController {


    @GetMapping("zy")
    public String zy(@RequestBody  RegxReq regxReq){

        String content = "三餐阿萨啥课的哈萨克鲨科技的卡收到货卡的技术安静收到货看见啥考虑到";

        String regx =  regxReq.getContent();

        System.out.printf("regx: %s \n",regx);

        String newContent = content.replaceAll(regxReq.getContent(),"*");


        return newContent;
    }

}
